﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.Domain.Migrations
{
    public partial class NBHY : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Aquaculture",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FeedDay = table.Column<int>(type: "int", nullable: false),
                    FeedBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Headfeeding = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    LeaveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Aquaculture", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "DeepProcessing",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClassGroup = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    PersonCharge = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeepProcessing", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "Enterprise",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<int>(type: "int", nullable: false),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Manager = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number_storage = table.Column<int>(type: "int", nullable: true),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateCompanyTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CompanyMessage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompanyImage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StepsType = table.Column<int>(type: "int", nullable: true),
                    CompanyLicense = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Enterprise", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "Health",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FeeDays = table.Column<int>(type: "int", nullable: false),
                    HealthType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthIdea = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Health", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "Image",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Type = table.Column<int>(type: "int", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PictureMaterials = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Image", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "productNames",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    productName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_productNames", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "Slaughter",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Slaughter_Bath = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EqualWeight = table.Column<int>(type: "int", nullable: false),
                    ArrivalTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughter", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "TraceabilityManagement",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductNameid = table.Column<int>(type: "int", nullable: true),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ShelfLife = table.Column<int>(type: "int", nullable: false),
                    ProductionLicense = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manufacturer = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Informationlmprovement = table.Column<int>(type: "int", nullable: false),
                    CoverImage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductInspectionReportPath = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    updateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    updateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    del = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TraceabilityManagement", x => x.id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Aquaculture");

            migrationBuilder.DropTable(
                name: "DeepProcessing");

            migrationBuilder.DropTable(
                name: "Enterprise");

            migrationBuilder.DropTable(
                name: "Health");

            migrationBuilder.DropTable(
                name: "Image");

            migrationBuilder.DropTable(
                name: "productNames");

            migrationBuilder.DropTable(
                name: "Slaughter");

            migrationBuilder.DropTable(
                name: "TraceabilityManagement");
        }
    }
}
